# Contributor: pcworld <0188801@gmail.com>
# Maintainer:
pkgname=libetebase
pkgver=0.5.1
pkgrel=0
pkgdesc="Etebase C library providing end-to-end encrypted backend as a service"
url="https://github.com/etesync/libetebase"
# s390x and riscv64 blocked by rust/cargo
arch="all !s390x !riscv64"
license="BSD-3-Clause"
makedepends="openssl-dev libsodium-dev cargo"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/etesync/libetebase/archive/refs/tags/v$pkgver.tar.gz"
options="!check"

export SODIUM_USE_PKG_CONFIG=1

build() {
	make
}

package() {
	make DESTDIR="$pkgdir" install

	# Move the solink-named library to a full path then create
	# symlinks, soname is already set but upstream didn't create
	# these
	# See: https://github.com/etesync/libetebase/issues/4
	mv "$pkgdir/usr/lib/libetebase.so" "$pkgdir/usr/lib/libetebase.so.0.0.0"
	ln -s libetebase.so.0.0.0 "$pkgdir/usr/lib/libetebase.so.0"
	ln -s libetebase.so.0.0.0 "$pkgdir/usr/lib/libetebase.so"
}

sha512sums="
73a6c861bd6adfef80fa7bc90b1f229351916ad8ecb508d27756ad12d9e653641531efcd0e1f85c5fc3b0b15c27c8c20a4efcf6a811cb331fb456a65cc19b9eb  libetebase-0.5.1.tar.gz
"
